<template>
	<div></div>
</template>

<script>
	export default {
		data() {
			return {
				lat: '0',
				lng: '0',
				title: '杨柳青庄园'
			};
		},
		onLoad: function(option) { //option为object类型，会序列化上个页面传递的参数
			this.lat = option.lat;
			this.lng = option.lng;
			this.title = option.title;
		},
		mounted() {
			let plugin = requirePlugin('routePlan');
			let key = '2UUBZ-ZFYWG-TD6QX-QLD5O-XYQ2V-CIFUC'; //使用在腾讯位置服务申请的key
			let referer = '八维漫游'; //调用插件的app的名称
			let endPoint = JSON.stringify({ //终点
				'name': this.title,
				'latitude': Number(this.lat),
				'longitude': Number(this.lng)
			});
			uni.navigateTo({
				url: 'plugin://routePlan/index?key=' + key + '&referer=' + referer + '&endPoint=' + endPoint +
					'&navigation=' + 1
			});
		}
	}
</script>

<style>
</style>
